basic level: kindergarden

Quickly Cover the basics of SilverBullet

Key Bindings

Format Syntax

Emoji

Orgnizing Workflows

Dir Tree

Create Page alongside Current Folder

  1. ${Green("Ctrl + L")} - Navigate: Page Picker

  2. ${Green("Space")} - Input: Current Folder

  3. Iput: “Page Name”

  4. ${Green("Shift + Enter")} - Create (aspiring) Page

    Create Page inside Current Folder

    if this_file.dir_level == top_1

  1. ${Green("Ctrl + /")} - Navigate: Command Picker
  2. Input: “Page Copy” then ${Green("Enter")}
  3. Input: “/Page Name” then ${Green("Enter")}
  4. \({Green("Ctrl + A")} then \){Green("Backspace")}

Wiki Web

Rename a Page with its Backlinks

  1. \({Green("Ctrl + Enter")} or \){Green("Click")} to enter the (aspiring) page

  2. Rename its Title will automatically update its backlinks

    Navigate Cursors History

  3. Language/Input Method/声笔飞单\({Green("Ctrl + Enter")} → \){Green("Alt + ←")}

Tags (for aggregating Objs with the same tags)

  • #Tag itself is an Object as the index.tag to be indexed.

  • its name “Tag” looks like a “Key without Value”.

  • #Tag defines what the Object, e.g. Page/Line, is (about).

  • it is one of the Object’s Properties (if obj has many Tags).

    • Page Object itself implicitly has a #Page (i)tag for indexing.
  • a #Tag is also a Class with a cluster of Instances = Objects = Rows in Table.

    • So, Tag = Table

      Aggregation for future

    1. [ ] assign a #Todo tag for every todo,
    2. then Enter this ↑ Page to Filter all Todos

IndexDB Query

Terminology Mapping

Fields / Metadata (for differentiating Objs with the same tags)

  • a Page itself is an Object as well, like #Tag.

  • it exists in the Table as Row

  • it too could have some Attributes/Properties,

  • that is, key-value pairs as front matter.

  • add Key:Value pairs for Page Object, on the Page's Front Matter

    • using another Markup language: Yaml
  • fields are indexed in ${query[from index.tag "Obj's Tag"](from index.tag "Obj's Tag")} Table

  • Objs are Rows in the Table

  • Keys are Columns in the first Row

    • are just names (whose types are all implictly "strings"?)

    • Values are Columns in >= 2nd Rows

    • can be numbers, strings, booleans, lists

      [CustomAttribute:1️⃣]

      ${query[from index.tag "SBitself" select {ttest=.CustomAttribute, name="[" .. _.name .. "", emm="basic level", ref=.ref, itags=.itags}]]}

      [CustomAttribute:2️⃣] [CustomAttribute2:ddd]

      ${queryfrom index.tag "header" where CustomAttribute}

      Query Objects beyond Page & Header: Item & Task

  • Hello #like #tana [but:"custom"] [fields:do not belong to tags] the \({Red("/query")} below... better not be in/alongside this item itself... \){queryfrom index.tag "tana"}

  • [x] Clean the floors [dueDate: 2025-10-16]

  • [ ] Do the dishes [dueDate: 2025-10-18] all \({Red("/queryed")} objs better not have `\){Red("expression")}` in its name ${queryfrom index.tag "task"}

    Task Done State is live updating, but sync editing text is not,

    ${template.each(queryfrom index.tag "task" where not done, templates.taskItem)}

    the ![transclusions] is not “edit one place edit everywhere” as well

  • https://youtu.be/cH9cs8fowhY?t=879

Dive in SilverBullet itself

a Page becomes a meta Page, when

  • the page is tagged with #meta (either at the top or the bottem)

  • meta Pages in Library/Std is inside SB, thus not disk-visible, editable or Page Picker able. They updates with SB itself.

    • Logically speaking, the (CONFIG + STYLE) (pages + folders) should be taged with #meta, and put under folder ${Blue("Library/User/")}

    • rather than taged with #SB_itself, and put under ${Blue("space/")}

      \({Green("Ctrl + /")} and input: \){Red("Navigate: meta( Page) Picker")}

${Green("Ctrl + Shift + l")}, and search for

  • Space Overview > - in which \({Yellow("active space-lua scripts")} are indexed/listed in sequence and [excuted (constantly running) by priority](https://youtu.be/qkLJ3viVq8I?t=1398) > - [System Reload](https://youtu.be/qkLJ3viVq8I?t=1378) will \){Blue("ReRun")} all ${Yellow("existing space-lua scripts")} > - See web brouser’s console - F12 > - Print(“...”) is there

Custom Widgets built using space-lua

  • ${embed.youtube "https://youtu.be/qkLJ3viVq8I?t=1850"}

    • \({Red("\){embed.youtube 'url'}")} 's inplementation can be found in

      • ${Green("Ctrl + Shift + l")} → search for Library/Std/Widgets/Embed#Implementation

      • Note that it is a non-local function which defines this widget

        One usage of non-local function: called by Widgets

  • Both \({Yellow("local varName = varValue")} and \){Yellow("local function end")} have their scopes confined to the space-lua block in which they are defined.

    • is a good way to ==not pollute== the global namespace too much
  • non-local \({Yellow("varName = varValue")} and \){Yellow("function fn() end")} can be acquired

    • by subsequent space-lua code blocks following the executed order?

    • by widgets @ anywhere that call them

      Lua tricks

  • https://www.lua.org/manual/5.3/

  • table is actually the only data structure in Lua?

  • \({Yellow("local ok, message = pcall(function() ... end)")} is a Lua way of \){Yellow("try: catch/except")}

    Slash command list behave differently inside a code block

  • generally, it generate some ${Yellow("command.define")} templates, e.g.:

slashCommand.define {
  name = "",
  run = function()
    editor.insertAtCursor("Hello |^| world!", false, true)
  end
}
  • similiar to “Quicker Movements Page switch between Apps”

    Some documents are @ https://silverbullet.md/API rather than @ Librabry/Std

  • It seems that all those Apis which can be borrowed to use inside space-lua blocks, can also be directly called inside \({Red("\){...}")}, which is to say: all widgets are global space-lua functions that are called

    • ${shell.run("ls", {"-l"})}
  • ${Green("Win/CMD + click")} the called function will jump on its definition (across pages)

    • if the corresponding particular API is globally accessible and that this has been implemented in space Lua
      1. ${Yellow("toggleReadOnlyMode()")} inside CONFIG/Edit/Read_Only_Toggle
      2. ${Yellow("slashCommand.define")} in SB Basics#Slash command list behave differently inside a code block
        • \({Green("Win/CMD + click")} inside \){Yellow("d|e|f|i|n|e|")} is effective
        • but it is of no use to \({Green("Win/CMD + click")} the \){Yellow("slashCommand.")}
    • ${Green("Win/CMD + click")} called local functions seems not working

Configuration SilverBullet

https://silverbullet.md/Space%20Lua/Lua%20Integrated%20Query hand in my assignment below! ${query[[from index.tag "space-lua" where string.match(.script, "key = \"([^\n]+)\",") select {ref=.ref, key=string.match(_.script, "key = \"([^\n]+)\",")}]]}

CONFIG STYLE QUERY

#SB_itself